export class MenuScene extends Phaser.Scene {

    private startKey: Phaser.Input.Keyboard.Key;

    constructor() {
        super({ key: 'MenuScene' });
    }

    create(): void {
        let { width, height } = this.game.config;
        
        this.add.sprite(width as number / 2, height as number / 2, 'title');

        this.add.text(width as number / 2 + 10, height as number / 2 + 150, 'Press Space to Start', {fontSize: '16px', color: '#fff'})
            .setOrigin(0.5)
            ;
        this.startKey = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.SPACE);
        this.startKey.onDown = () => {
            this.scene.start('PlayScene');
        };
    }
}